package com.koron.sinoprobe.web.plan.service;

import com.koron.bean.workflow.RedirectQuery;
import com.koron.sinoprobe.web.plan.bean.entity.SpPlan;
import com.koron.sinoprobe.web.plan.bean.query.SpPlanQuery;
import com.koron.sinoprobe.web.plan.bean.vo.SpPlanVO;
import org.koron.ebs.mybatis.SessionFactory;

import java.util.List;
import java.util.Map;

/**
 * @author twcao
 * @title: SpPlanService
 * @projectName GDH_EAM_V2
 * @description: 专项计划service
 * @date 2021/11/2417:50
 */
public interface SpPlanService {

    SpPlanVO selectOne(SessionFactory factory, String planId);

    List<SpPlanVO> queryList(SessionFactory factory, SpPlanQuery query);

    List<SpPlanVO> getByPkgId(SessionFactory factory, String pkgId);

    List<Map<String, Object>> groupByPkgId(SessionFactory factory, String pkgId);

    SpPlanVO saveOrUpdate(SessionFactory factory, SpPlanVO detail);

    boolean saveOrUpdateBatch(SessionFactory factory, String pkgId, List<SpPlan> list);

    SpPlan update(SessionFactory factory, SpPlan plan);

    SpPlanVO submit(SessionFactory factory, SpPlanVO detail);

    SpPlanVO auditFinish(SessionFactory factory, SpPlanVO detail);

    SpPlanVO issue(SessionFactory factory, String planId);

    String hiddenById(SessionFactory factory, String planId);

    String hiddenByPkgId(SessionFactory factory, String pkgId);

    Boolean deleteById(SessionFactory factory, String planId);

    /**
     * 工作流更新
     * @param factory
     * @param redirectQuery
     */
    Boolean workflowUpdate(SessionFactory factory, RedirectQuery redirectQuery);

    /**
     * 专项计划包状态变更
     * @param factory 会话
     * @param pkgId 专项计划包id
     * @param pkgStatus 变更后的状态
     * @return
     */
    Boolean updateStatus(SessionFactory factory, String pkgId, String pkgStatus);
}
